import React, { useEffect, useState } from "react";
// import axios from "axios";
// import http from "../../../utils/http";
import { ratedApi } from "../../../utils/api";

const Index = () => {
  const [list, set_list] = useState([]);

  useEffect(() => {
    // axios.get("http://www.pudge.wang:3080/api/rated/list").then((res) => {
    //   set_list(res.data.result);
    // });

    (async () => {
      const res = await ratedApi({ a: 3, b: 4 });
      set_list(res.result);
    })();
  }, []);

  return (
    <>
      <div>这是电影页面</div>
      <ul>
        {list.map((item) => (
          <li key={item._id}>{item.title}</li>
        ))}
      </ul>
    </>
  );
};

export default Index;
